Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrollToElement fails when element has position of 0 #127

Closed
wants to merge 1 commit into from

Conversation

ksykulev
Copy link

Found an issue where if you are trying to use scrollToElement with an element that is positioned at either top 0 or left 0, jscrollpane fails to scroll to that element.

Checking if a variable is undefined using a regular
'if(variable)'
is generally unsafe, especially when you're dealing with coordinates.
Since you potentially run into the issue of
variable = 0
if(variable)

@ksykulev
Copy link
Author

If you solved it using isNaN already. You can just close this issue.

If you want to merge it into the master branch on your repository just go to your terminal and type in
$ git pull https://github.com/ksykulev/jScrollPane.git master
That will pull in my changes. Then just push origin master if you are satisfied with how it works.

Thanks.
-Konstantin

@vitch
Copy link
Owner

vitch commented Jul 20, 2013

Sorry for not managing to look at this pull request for so long! It sounds valid to me although I think I prefer the isNaN approach suggested by @nmiddleweek...

Can you submit a pull request for that please? Also updating the last updated date in the comments at the top and generating a new minified version with yui compressor? (sorry the process is so manual - I haven't had any time to update this project to use grunt and make it easy to share the publishing process)

@nkmdk-007
Copy link
Contributor

Yup, sure, I'll create a pull request... Cheers guys.

@vitch
Copy link
Owner

vitch commented Jul 30, 2013

Fixed in #244 :)

@vitch vitch closed this Jul 30, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants